package framework.service.client;

import framework.Service;

/**
 * Defines the method clientRequest what accept a request from a client. <br>
 * If the client is not recognized should call {@link ClientManager#nextClient(ClientMessage)}
 * in order to resends {@link ClientMessage} message to the next ClientService 
 * into the list <br>
 * For example:<br>
 * <pre>
 * public void clientRequest(ClientMessage message) {
 *   ...
 *   /* request doesn't accepted * /
 *   Server server = (Server)container;
 *   ClientManager clientManager = (ClientManager) server.getService(ClientManager.class.getName());
 *   clientManager.nextClient(message);
 * }
 * </pre>
 *   
 * Client messages:
 * <table border="1">
 * <tr>
 * <th>where</th>
 * <th>receiver</th>
 * <th>sender</th>
 * <th>content</th>
 * </tr>
 * <tr>
 * <td>{@link ClientManager#clientConnected(java.net.Socket)}</td>
 * <td>{@link ClientService}</td>
 * <td>rest of {@link ClientService}</td>
 * <td>{@link ClientRequest}</td>
 * </tr>
 * <table><br>
 * 
 * @author	Orlin Tomov
 * @version	0.2
 *
 */
public interface ClientService extends Service {

	/** 
	 * Should accepts client request if it is recognized. Elsewhere should resends  
	 * {@link #process} message to the next ClientService calling 
	 * {@link ClientManager#nextClient(ClientMessage)}
	 * @param	message
	 */
	public void process(ClientMessage message);
}
